package stu.info.student.info.mapper;

import org.apache.ibatis.annotations.*;
import stu.info.student.info.entity.Admin;
import stu.info.student.info.entity.Student;

import java.util.List;

@Mapper
public interface studentMapper {
    /*添加学生*/
    @Insert("insert into student values(null,#{sname},#{sex},#{sdept},#{phone})")
    void insert(Student student);

    /*删除学生根据学号*/
    @Delete("delete from student where sno=#{sno}")
    void deleteById(Long sno);

    /*获得学生数据*/
    @Select("select sno,sname,sex,sdept,phone from student")
    List<Student> select();

    /*根据id更新学生数据*/
    @Update("update student set sname=#{sname},sex=#{sex},sdept=#{sdept},phone=#{phone} where sno=#{sno}")
    void updateById(Student student);
}